<template>
	<!-- 项目 -->
	<view class="upload">
		<view class="" v-if="activeTab==0 && projectData.length>0">
			<view class="footer" v-for="(item,index) in projectData">
				<text class="ttt">{{item.name}}</text>
				<text class="ccc">{{userinfo.name}}</text>
				<text class="ccc">{{item.engineering_cycle}}</text>
			</view>
			<image v-if="projectData.length<1"
				style="position: absolute;top:0;left: 0;bottom: 0;right: 0;margin: auto;width: 600rpx;"
				src="../../../static/image/no-data.png" mode=""></image>
		</view>
	</view>
</template>

<script>
	import uniTabs from '@/components/v-tabs/v-tabs.vue'
	import api from '@/static/js/api.js'
	export default {
		components: {
			uniTabs
		},

		data() {
			return {
				tabs: [
					// '当前项目',
					'往期项目',
				],
				activeTab: 0,
				projectData: [],
				userinfo: ''
			}
		},
		onShow() {
			this.userinfo = JSON.parse(uni.getStorageSync('userInfo'));
			this.workerClass()
		},
		methods: {
			// change(index) {
			// 	this.activeTab = index
			// }
			workerClass() {
				api.workerClass('res.partner', '_api_home_worker_list', this.userinfo.access_token, this.userinfo.uid)
					.then(res => {
						this.projectData = res.data.project_list
					}).catch(e => {
						uni.showToast({
							icon: 'none',
							title: e.message
						})
					})
			}
		}

	}
</script>

<style lang="less" scoped>
	.upload {
		width: 100%;
		height: 100vh;
		background-color: #EBEEF5;
	}

	.tabs {
		position: relative;
	}

	/deep/ .v-tabs {
		width: 100%;
		height: 100rpx;
		background-color: #FFFFFF;
		line-height: 100rpx;
	}

	/deep/ .v-tabs__container-item {
		width: 100%;
		justify-content: center;
	}

	.top {
		font-size: 28rpx;
		margin-top: 20rpx;
		background-color: #FFFFFF;

		.nav {
			display: block;
			padding: 30rpx;
			color: #DD524D;
			font-size: 30rpx;
			font-weight: 600;
		}

		view {
			padding: 15rpx 40rpx;
			display: flex;
			justify-content: space-between;
		}
	}

	.footer {
		margin-top: 20rpx;
		background-color: #FFFFFF;

		text {
			display: block;
		}

		.ttt {
			font-size: 30rpx;
			padding: 15rpx 40rpx;
		}

		.ccc {
			font-size: 28rpx;
			padding: 15rpx 40rpx;
			color: #808080;
		}
	}
</style>
